﻿
@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Index.cshtml";
}
<style type="text/css">
    .form .formValue input.form-control {
        height: 32px;
        line-height: 32px;
        padding: 0px;
        resize: none;
        border-radius: 0px;
        box-shadow: none;
        text-indent: 5px
    }

    .textValue {
        width: 100%;
    }

    .selectbox {
        color: #444;
        line-height: 34px;
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        height: 34px;
        width: 100%;
    }

    .search {
        margin-left: 10px;
        padding: 0px;
    }

    table td {
        height: 40px;
        line-height: 40px;
    }

    .zdyPanel {
        background-color: #fff;
        border-top: 1px solid #ddd;
        border-left: 1px solid #ddd;
        border-right: 1px solid #ddd;
        margin: 0px;
        float: left;
        width: 100%;
    }

    .zdyTool {
        float: left;
        padding-left: 10px;
        width: 100%;
    }

    .zdyBar {
        padding: 0px;
        margin: 0px;
        margin-top: 3px;
    }

    .zdyUL {
        list-style-type: none;
        margin: 5px 0px 0px -3px;
        padding: 0px;
    }

        .zdyUL li {
            float: left;
            list-style: none;
            height: 24px;
            line-height: 22px;
        }

            .zdyUL li a {
                cursor: pointer;
                padding: 5px 10px;
                border-radius: 4px;
            }

            .zdyUL li i {
                margin-right: 4px;
                font-size: 13px;
                color: #666;
                vertical-align: middle;
                margin-top: -1px;
            }

            .zdyUL li a:hover {
                text-decoration: none;
                background-color: #1ABC9C;
                color: #fff;
            }

    .zdyGirdPanel {
        width: 100%;
        margin: 0px;
        padding: 0px;
        float: left;
    }

    .zdyContentPanel {
        width: 100%;
        margin: 5px 0px 0px 0px;
        padding: 0px;
        float: left;
    }

    .zdyFont {
        padding-left: 5px;
        color: #ff6a00;
    }

    .autocomplete-suggestions {
        -webkit-box-sizing: border-box;
        -moz-box-sizing: border-box;
        box-sizing: border-box;
        border: 1px solid #999;
        background: #FFF;
        cursor: default;
        overflow: auto;
        -webkit-box-shadow: 1px 4px 3px rgba(50, 50, 50, 0.64);
        -moz-box-shadow: 1px 4px 3px rgba(50, 50, 50, 0.64);
        box-shadow: 1px 4px 3px rgba(50, 50, 50, 0.64);
    }

    .autocomplete-selected {
        background: #F0F0F0;
    }

    .autocomplete-suggestion {
        padding: 2px 5px;
        white-space: nowrap;
        overflow: hidden;
    }

    .autocomplete-no-suggestion {
        padding: 2px 5px;
    }

    .zdyUL {
        list-style-type: none;
        margin: 5px 0px 0px -3px;
        padding: 0px;
    }

        .zdyUL li {
            float: left;
            list-style: none;
            height: 24px;
            line-height: 22px;
        }

            .zdyUL li a {
                cursor: pointer;
                padding: 5px 10px;
                border-radius: 4px;
            }

            .zdyUL li i {
                margin-right: 4px;
                font-size: 13px;
                color: #666;
                vertical-align: middle;
                margin-top: -1px;
            }

            .zdyUL li a:hover {
                text-decoration: none;
                background-color: #1ABC9C;
                color: #fff;
            }

    .zdyGirdPanel {
        padding-top: 3px;
    }

    .form .formValue {
        padding: 1px 3px;
    }
</style>
<div class="zdyPanel">
    <div class="zdyBar" style="float:left;white-space:nowrap;width:65%;">
        <div class="search">
            <table class="form" style="width:100%;">
                <tr>                    
                    <td class="formValue">
                        <select id="F_DeptId" name="F_DeptId" class="selectbox">
                            <option value="">==请选择部门==</option>
                        </select>
                    </td>  
                    <td class="formValue">
                        <div class="input-group">
                            <input id="F_CreatorDate" placeholder="创建开始时间" name="F_CreatorDate" type="text" class="form-control input-wdatepicker required" readonly onfocus="WdatePicker()" style="width:95px;">
                            <div class="input-group-addon" style="border-right-width: 0; border-left-width: 0;">至</div>
                            <input id="F_CreatorDate2" placeholder="创建结束时间" name="F_CreatorDate2" type="text" class="form-control input-wdatepicker required" readonly onfocus="WdatePicker()" style="width:95px;">
                        </div>
                    </td>
                </tr>               
            </table>
        </div>
    </div>
    <div class="zdyBar" style="float:right;white-space:nowrap;width:35%;padding-top:5px;">
        <div style="float:right;margin-right:5px;">
            <div class="btn-group">
                <a class="btn btn-primary" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span></a>
            </div>            
        </div>
    </div>
</div>
<div class="gridPanel">
    <table id="gridList"></table>
    <div id="gridPager"></div>
</div>
<script>
    $(function () {
        initGridList();
    });

    //初始化列表
    function initGridList() {
        var $gridList = $("#gridList");

        $gridList.dataGrid({
            url: "/SystemSecurity/Log/GetLogGridJson",
            postData: {},
            height: 850,
            colModel: [
                {
                    label: '登陆人', name: 'F_NickName'
                },
                {
                    label: '部门', name: 'deptName'
                },
                {
                    label: '时间', name: 'F_Date'
                },
                {
                    label: 'IP', name: 'F_IPAddress'
                },
                {
                    label: 'IP 地址', name: 'F_IPAddressName'
                },
                {
                    label: '类型', name: 'F_Type', formatter: function (cellvalue) {
                        switch (cellvalue) {
                            case 'Other':
                                return '其他';
                            case 'Login':
                                return '登录';
                            case 'Exit':
                                return '退出';
                            case 'Visit':
                                return '访问';
                            case 'Create':
                                return '新增';
                            case 'Delete':
                                return '删除';
                            case 'Update':
                                return '修改';
                            case 'Submit':
                                return '提交';
                            case 'Exception':
                                return '异常';
                            default:
                                return '';
                        }
                        return '';
                    }
                },
                {
                    label: '模块', name: 'F_ModuleName'
                },
                {
                    label: '描述', name: 'F_Description'
                }
            ],
            pager: "#gridPager",
            viewrecords: true,
            multiselect: false,
            sortname: 'F_Date',
            sortorder: 'desc',
            ondblClickRow: function (rowid, iRow, iCol, e) {

            }
        });
    }
</script>

